﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link rel="stylesheet" type="text/css" href="admin/css/public.css">
</head>

<body>
<meta charset='utf8'/>
<div  id="main">
<h2>添加新闻</h2>
<form name="login"  action="one_news_add" method="post" enctype="multipart/form-data">
    {{ csrf_field() }}
<table border="0"    cellspacing="10" cellpadding="0">
  <tr>
    <td>新闻标题：</td>
    <td><input   type="text" name="news_title"  id="news_title" class="txt"/></td>
  </tr>
  <tr>
    <td>所属分类：</td>
        <td>
            <select   name='p_name' id="p_name">
                @foreach($type as $v)
                <option value="{{$v->id}}">{{$v->name}}</option>
                @endforeach
	        </select>
            <select name="a_name" id="a_name">

            </select>

            <select name="b_name" id="b_name">

            </select>
      </td>
  </tr>
    <tr>
    <td>新闻类型：</td>
        <td>
            <select   name='cate_name' id="cate_name">
                <option value="普通新闻">普通新闻</option>
                <option value="视频新闻">视频新闻</option>
                <option value="图片新闻">图片新闻</option>
	        </select>
	</td>
  </tr>

  <tr>
    <td>新闻内容：</td>
    <td><textarea  name="content" id="content" class="textarea"></textarea></td>
  </tr>

    <tr>
        <td>添加人：</td>
        <td><input   type="text"  name="news_man"  id="news_man" class="txt"/></td>
    </tr>

    <tr>
        <td>添加资源：</td>
        <td><input   type="file" id="face"  name="face"/></td>
    </tr>


    <tr>
        <td>时间：</td>
        <td><input   type="date"  name="created_at"  class="txt"/></td>
    </tr>
    
  <tr>
    <td>&nbsp;</td>
    <td><input  type="submit" value="添 加"  class="sub" /><input  type="reset" value="重 置"  class="res"/></td>
  </tr>
</table>

</form>
</div>
</body>
</html>

<script src="jquery.js"></script>
<script type="text/javascript">
    $("#p_name").change(function(){
        var p_name=$("#p_name").val();
        $.ajax({
            url:"one_news_yes",
            data:{
                id:p_name,
            },
            success:function(e){
                $("#a_name").html(e);
            }

        })
    })
    $("#a_name").change(function(){
        var p_name=$("#a_name").val();
        $.ajax({
            url:"one_news_yes",
            data:{
                id:p_name,
            },
            success:function(e){
                $("#b_name").html(e);
            }

        })
    })
</script>
